#include "Avalon/IO/BufferWriter.hpp"

using namespace Avalon;
using namespace Avalon::IO;
using namespace Avalon::Threading;

BufferWriter::BufferWriter() {}

BufferWriter::~BufferWriter() {}

const Buffer& BufferWriter::GetBuffer() {
  return m_buffer;
}

Async<void>::Ptr BufferWriter::Write(const void* data, int size) {
  m_buffer.Append(data, size);
  return NewAsync();
}

Async<void>::Ptr BufferWriter::Write(const Buffer& data) {
  m_buffer.Append(data);
  return NewAsync();
}
